#ifndef _TEXTURE_H_
#define _TEXTURE_H_

#include <Windows.h>
#include "GL/gl.h"
#include <string>


class CTextureManager;

class CTexture
{
	friend class CTextureManager;

public:
	
	void SetColorKey(unsigned char Red, unsigned char Green, unsigned char Blue);

	unsigned int GetWidth()  const  { return m_TextData.nWidth;  }

	unsigned int GetHeight() const  { return m_TextData.nHeight; }

	void AddReference();
	void ReleaseReference();

	void Bind() const;

protected:

	CTexture(const std::string& strFileName);
	~CTexture();

private:

	void LoadFile(const std::string& strFileName);

	struct STextureData
	{
		
		unsigned int   nWidth;
		
		unsigned int   nHeight;
		
		unsigned char* pData;
	};
	STextureData m_TextData;

	mutable GLuint m_glId;


	int m_iRefCount;
	std::string m_strTextName;
};

#endif  